package db

import (
	"github.com/lishimeng/app-starter"
	"time"
)

type ScheduleState string

const (
	ScheduleStateOk   ScheduleState = "Success"
	ScheduleStateFail ScheduleState = "Fail"
)

type ScheduleMemo struct {
	LastState ScheduleState `orm:"column(last_state);null"`
	Memo      string        `orm:"column(memo);null"`
}

type RtpSchedule struct {
	app.Pk
	Name     string    `orm:"column(name)"`
	Template string    `orm:"column(template)"`
	StartAt  time.Time `orm:"column(start_at)"`
	NextRun  time.Time `orm:"column(next_run)"`
	Cron     string    `orm:"column(cron)"`
	ScheduleMemo
	app.TableChangeInfo
}

func (t *RtpSchedule) TableName() string {
	return "amazon_rpt_schedule"
}
